home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Demo / DesktopX / objects / GT3mail.dxpack / {A6F05FA1-12A7-40E7-888C-73E69D2A3F31}.DXScript2 < prev    next >
Extensible Markup Language  |  2004-11-25  |  6KB  |  150 lines

  1. <?xml version="1.0"?>
  2. <!--DXScript Data File.  Version 2.0-->
  3. <DXScript>
  4.     <Script><![CDATA[    '==================================================================================
  5.     '================================COLOUR STUFF======================================
  6. Dim thehues
  7. Dim thecolours
  8. Dim thegraphicobjects    'array of all graphic objects
  9. Dim thetextobjects        'array of all single state text objects
  10. Dim colourcode
  11. '===================================================================================
  12. Dim interval,intervalM, mail
  13. Dim playsounds, thehue, theopacity
  14. Dim objNum'will be defined as the trailing numbers of this object's name, enables cloning
  15. Dim uid
  16.  
  17. Sub Object_OnScriptEnter
  18.     objNum=Right(Object.Name,Len(Object.Name)-13)
  19.     '==================================================================================
  20.     '=========================the next values can be modified==========================
  21.     uid="email"'unique identifier used by the script for saving position and other things
  22.     '==================================================================================
  23.     '================================COLOUR STUFF======================================
  24.     thehues=Array(0,32,64,96,128,160,192,224)
  25.     thecolours=Array(15121012,15891082,15102935,10187750,7643367,7661786,7661440,12576371)
  26.     thegraphicobjects=Array("GT3mm_display"&objNum,"GT3mm_glyph"&objNum)
  27.     thetextobjects=Array("GT3mm_files"&objNum)
  28.     '==================================================================================
  29.     mail=False
  30.     loadsettings
  31.     applycolour
  32. End Sub
  33.  
  34. '==================================================================================
  35. '==============================audible alert routines==============================
  36. Sub Object_OnStateChange(state)
  37.     If state="Command executed" Then
  38.         prompt="enter the time in minutes between audible alerts"&Chr(13)&"for once only audible alert enter 0 or press cancel"&Chr(13)&"for no audible alert at all enter -1"
  39.         Do
  40.             x=InputBox(prompt,"GT3 mail",interval) 
  41.         Loop until isnumeric(x)=True
  42.         interval=CSng(x)
  43.         intervalM=interval*60000
  44.         savesettings
  45.         If mail Then
  46.             object.SetTimer 1,intervalM
  47.         End If
  48.     End If
  49. End Sub
  50.  
  51. Sub alerton
  52.     mail=True
  53.     If interval=0 Then    
  54.         Object_OnTimer1
  55.     ElseIf interval>0 Then
  56.         Object_OnTimer1
  57.         object.SetTimer 1,intervalM
  58.     End If
  59. End Sub
  60.  
  61. Sub alertoff
  62.     mail=False
  63.     object.killtimer 1
  64. End Sub
  65.  
  66. Sub Object_OnTimer1'timer for playing alert sounds
  67.     desktopx.Object("GT3mm_sfx"&objNum).state="alert"
  68.     object.killtimer 1
  69.     object.SetTimer 1,intervalM
  70. End Sub
  71. '==================================================================================
  72.  
  73. Function Object_OnLButtonUp(x, y, Dragged)
  74.     If dragged Then
  75.         savesettings
  76.     End If
  77. End Function
  78.  
  79. 'Called when the script is terminated
  80. Sub Object_OnScriptExit
  81.  
  82. End Sub
  83. '=============================COLOUR CYCLING====================================
  84. Sub cyclecolour
  85.     colourcode=colourcode+1
  86.     If colourcode>7 Then colourcode=0
  87.     applycolour
  88.     savesettings
  89. End Sub
  90.  
  91. Sub applycolour
  92.     For g=0 To UBound(thegraphicobjects)
  93.         If desktopx.IsObject(thegraphicobjects(g)) Then
  94.             desktopx.Object(thegraphicobjects(g)).states("").hue=thehues(colourcode)
  95.             desktopx.Object(thegraphicobjects(g)).visible=True
  96.         End If
  97.     Next
  98.     For t=0 To UBound(thetextobjects)
  99.         If desktopx.IsObject(thetextobjects(t)) Then
  100.             s=desktopx.Object(thetextobjects(t)).state
  101.             If s="active" Or s="inactive" Then'dual state text object
  102.                 desktopx.Object(thetextobjects(t)).states("active").textcolor=thecolours(colourcode)
  103.                 desktopx.Object(thetextobjects(t)).states("inactive").textcolor=rgb(0,0,0)
  104.                 desktopx.Object(thetextobjects(t)).visible=True
  105.             Else
  106.                 desktopx.Object(thetextobjects(t)).states("").textcolor=thecolours(colourcode)
  107.                 desktopx.Object(thetextobjects(t)).visible=True
  108.             End If
  109.         End If
  110.     Next
  111.     thehue=thehues(colourcode)
  112. End Sub
  113.  
  114. '========================== SAVING AND LOADING =================================
  115. Sub loadsettings'loads settings string from reg (And Set If Not existing):
  116.     Set Sh = CreateObject("WScript.Shell")
  117.     On Error Resume Next
  118.     x=Sh.RegRead("HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_x")
  119.     y=Sh.RegRead("HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_y")
  120.     s=Sh.RegRead("HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_state")
  121.     colourcode=Sh.RegRead("HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_cc")
  122.     interval=Sh.RegRead("HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_interval")
  123.     If err.number <> 0 Then
  124.         x=(system.WorkareaRight-object.Width)/2
  125.         y=(system.WorkareaBottom-object.Height)/2
  126.         s="normal"
  127.         interval=0
  128.         colourcode=0
  129.         savesettings
  130.         err.clear
  131.     End If
  132.     object.parent.object.Move x,y
  133.     object.parent.object.State=s
  134.     If s="blended" Then desktopx.Object("GT3mm_label"&objNum).visible=False
  135.     intervalM=interval*60000
  136.   Set Sh = Nothing
  137. End Sub
  138. Sub savesettings
  139.     x=object.parent.object.Left
  140.     y=object.parent.object.Top
  141.     s=object.parent.object.state
  142.     Set Sh = CreateObject("WScript.Shell")
  143.     Sh.RegWrite "HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_x", x
  144.     Sh.RegWrite "HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_y", y
  145.     Sh.RegWrite "HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_state", s
  146.     Sh.RegWrite "HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_cc", colourcode
  147.     Sh.RegWrite "HKCU\SOFTWARE\Stardock\DesktopX\Widget\Tiggz\GT3mm\"&uid&objNum&"_interval", interval
  148.     Set Sh = Nothing
  149. End Sub]]></Script><Globals><Editor><PropPane>0</PropPane><EditorLeft>31</EditorLeft><EditorTop>39</EditorTop><EditorRight>1289</EditorRight><EditorBottom>1132</EditorBottom></Editor><Object><LanguageCLSID>{B54F3741-5B07-11CF-A4B0-00AA004A55E8}</LanguageCLSID><ControlCLSID>{00000000-0000-0000-0000-000000000000}</ControlCLSID><ControlObjWidth>64</ControlObjWidth><ControlObjHeight>64</ControlObjHeight><RunState>1</RunState><ManualControlLoad>0</ManualControlLoad><ScriptHostVersion>2</ScriptHostVersion></Object></Globals></DXScript>
  150.